package main.java.day02;

/**
 * 将字符串"123abc456def789ghi"中的英文部分替换为"#char#"
 *
 * @author Xiloer
 */
public class Test04 {
    public static void main(String[] args) {
        String str = "123abc456def789ghi";
        method(str);
        str = str.replaceAll("[a-zA-Z]+", "#char#");
        System.out.println(str);

    }

    private static void method(String str) {
    str=str.replace("abc","#char#");
    str=str.replace("def","#char#");
    str=str.replace("ghi","#char#");
    }
}
